package br.com.tartarugasindomaveis.ti.app;

import java.io.IOException;
import java.io.InputStream;
import java.net.MalformedURLException;
import java.net.URL;

import android.graphics.drawable.Drawable;

public class CarregaImagem {

	public Drawable getImagem(String endereco) throws Exception {
		URL url = new URL(endereco);
		InputStream is = (InputStream) getObjeto(url);
		Drawable d = Drawable.createFromStream(is, "src");
		return d;
	}

	private Object getObjeto(URL url) throws MalformedURLException, IOException {
		Object content = url.getContent();
		return content;
	}
}
